from kyb_caps import *

# xpath定位
# # 绝对路径
# driver.find_element(By.XPATH,
#                     '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.EditText[1]').send_keys(
#     'ammyxh01')
# driver.find_element(By.XPATH,
#                     '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.EditText[2]').send_keys(
#     'ammyxh01')
# driver.find_element(By.XPATH,
#                     '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.ScrollView/android.widget.LinearLayout/android.widget.Button').click()
# sleep(3)

# 相对路径
driver.find_element(By.XPATH, '//android.widget.EditText[@text="请输入用户名"]').send_keys('ammyxh01ammyxh01')
driver.find_element(By.XPATH, '//android.widget.EditText[@text="请输入密码"]').send_keys('ammyxh01')
driver.find_element(By.XPATH, '//android.widget.Button').click()
sleep(3)

driver.quit()
